package com.googlecode.tda367.denty.core.dynamicbody;

import static com.googlecode.tda367.denty.constants.Hit.KEY;
import static com.googlecode.tda367.denty.constants.Hit.LOCK;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.jbox2d.dynamics.Fixture;
import org.jbox2d.dynamics.World;

import com.googlecode.tda367.denty.constants.Hit;

public class Key extends ThrowableBlock {

	public Key(World world, float x, float y) {
		super(world, x, y);
	}

	@Override
	public void beginContact(Fixture hitFixture, Collection<Hit> hitConstants) {
		if(hitConstants.contains(LOCK))
			this.setAlive(false);
	}

	@Override
	public Collection<Hit> getHitConstants(Fixture fixture) {
		List<Hit> hitConstants = new ArrayList<Hit>();
		hitConstants.add(KEY);
		return hitConstants;
	}

	@Override
	public String getImagePath() {
		return "res/img/block-key.png";
	}
}
